const res = []
fetch("https://insurance.hexun.com/bxhyzx/index-655.html", {
  "headers": {
    "accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7",
    "accept-language": "zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7",
    "cache-control": "no-cache",
    "pragma": "no-cache",
    "sec-ch-ua": "\"Google Chrome\";v=\"125\", \"Chromium\";v=\"125\", \"Not.A/Brand\";v=\"24\"",
    "sec-ch-ua-mobile": "?0",
    "sec-ch-ua-platform": "\"macOS\"",
    "sec-fetch-dest": "document",
    "sec-fetch-mode": "navigate",
    "sec-fetch-site": "same-origin",
    "sec-fetch-user": "?1",
    "upgrade-insecure-requests": "1"
  },
  "referrer": "https://insurance.hexun.com/bxhyzx/index-656.html",
  "referrerPolicy": "strict-origin-when-cross-origin",
  "body": null,
  "method": "GET",
  "mode": "cors",
  "credentials": "include"
}).then(r => r.blob()).then((r) => {
  const reader = new FileReader()
  reader.readAsText(r, 'GBK') //查看网页编码：控制台输入document.charset
  reader.onload = () => {
    console.log('reader.result', reader.result)
    const domParser = new DOMParser()
    const document = domParser.parseFromString(reader.result, 'text/html').body
    let list = document.querySelectorAll('.temp01 li')
    list = [...list]
    // console.log('list', list)
    list.forEach(item => {
      const time = item.querySelector('span')?.textContent.match(/\((.+)\)/)?.[1]
      const content = item.querySelector('a')?.textContent
      const href = item.querySelector('a')?.getAttribute('href')
      res.push({ time, content, href })

    })
    console.log('res', res)

  }

})


